<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>表管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../style/index.css">
    
</head>

<body>
    <div id="app" v-cloak class="minWidth">
        <el-form :inline="true" :form="form">
            <el-form-item>
                <el-button type="primary" @click="Add">添加</el-button>
            </el-form-item>
            <el-form-item>
                <el-input placeholder="请输入表名称" clearable @change="onSerach" v-model.trim="form.Data"></el-input>
            </el-form-item>
            <!-- <el-form-item>
                <el-select @change="onSerach" placeholder="请选择字段类型" style="width: 100%;" v-model.trim="form.Type">
                    <el-option v-for="(item,index) in type" :key="index" :label="item.label" :value="item.value"></el-option>
                </el-select>
            </el-form-item> -->
            <el-form-item>
                <el-button type="primary" @click="onSerach">查询</el-button>
            </el-form-item>
        </el-form>
        <el-table :data="tableData.filter(i=>i.TABLE_NAME.includes(screen)).slice((form.page-1)*form.limit,form.page*form.limit)" stripe border 
            style="width: 100%" height="calc(100vh - 160px)" @expand-change="expandChange">
            <el-table-column align="center" width="50" type="expand">
                <template slot-scope="props">
                    <el-table :data="props.row.Children.base_table_detail" style="margin: 5px auto 0; width: 98%;" border>
                        <el-table-column prop="COLUMN_NAME" label="字段名称"></el-table-column>
                        <el-table-column prop="COLUMN_TYPE" label="字段类型"></el-table-column>
                        <el-table-column prop="COLUMN_COMMENT" label="字段备注"></el-table-column>
                        <el-table-column prop="COLUMN_DEFAULT" label="默认值"></el-table-column>
                        <el-table-column prop="IS_NULLABLE" label="允许为空">
                            <template v-slot="{row}">
                                <span>{{row.IS_NULLABLE!= 'NO'?'是':'否'}}</span>
                            </template>
                        </el-table-column>
                    </el-table>
                </template>
            </el-table-column>
            <el-table-column align="center" label="序号" width="50" type="index"></el-table-column>
            <el-table-column align="center" prop="TABLE_NAME" label="表名"></el-table-column>
            <el-table-column align="center" label="操作" width="180">
                <template v-slot="{row}">
                    <el-button type="success" size="small" @click="Edit(row.TABLE_NAME)">修改</el-button>
                    <el-button type="danger" :loading="row.loading" size="small" @click="Remove(row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination style="margin-top: 5px;" background @size-change="handleSizeChange"
            @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10, 20, 30, 50]"
            :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="tableData.filter(i=>i.TABLE_NAME.includes(screen)).length">
        </el-pagination>
    </div>
    <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../component/component.js"></script>
    <script type="text/javascript" src="../../../config/config.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/ID_Validity.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
</body>

</html>